package com.esri.core.internal.tasks.a;

import com.esri.core.geometry.Envelope;
import com.esri.core.geometry.GeometryEngine;
import com.esri.core.geometry.SpatialReference;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/* loaded from: classes.dex */
public class d extends com.esri.core.internal.tasks.f {
    private static final String f = "outFields";
    private static final String g = "searchExtent";
    private static final String h = "outSR";
    private static final String i = "Score";
    private static final String j = ",";
    private static final String k = "*";
    private static final long serialVersionUID = 1;
    public Map<String, String> a;
    public List<String> b;
    public SpatialReference c = null;
    public SpatialReference d = null;
    public Envelope e = null;

    @Override // com.esri.core.internal.tasks.f
    public boolean validate() {
        return true;
    }

    @Override // com.esri.core.internal.tasks.f
    public Map<String, String> generateRequestParams() throws Exception {
        SpatialReference spatialReference;
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        linkedHashMap.putAll(this.a);
        StringBuilder sb = new StringBuilder();
        List<String> list = this.b;
        if (list == null) {
            sb.append(i);
        } else if (list.contains(k)) {
            sb.append(k);
        } else {
            sb.append(i);
            for (String str : this.b) {
                sb.append(j);
                sb.append(str);
            }
        }
        linkedHashMap.put(f, sb.toString());
        SpatialReference spatialReference2 = this.c;
        if (spatialReference2 != null) {
            linkedHashMap.put(h, String.valueOf(spatialReference2.getID()));
        }
        Envelope envelope = this.e;
        if (envelope != null && !envelope.isEmpty() && (spatialReference = this.d) != null) {
            linkedHashMap.put(g, GeometryEngine.geometryToJson(spatialReference, this.e));
        }
        return linkedHashMap;
    }
}
